define(function (require, exports, module) {
	'use strict';
	require("model/ppm");
	var helper = require("model/helper"),
		jQuery = window.jQuery;
	exports.execute = function (me, $, load) {
		return function () {
			helper.moveToCenter(me);
			helper.initWindowTemplate(me);
			helper.component($(this).get(0));

			$("[data-pid]").click(function () {
				var pid;
				pid = $(this).attr("data-pid");
				load.ppm.checkout(pid);
				load.tpm.refresh("ui", load.ppm.getProgramList());
				load.tpm.close(me);
			});

			$("[data-remote-pid]").click(function () {
				var pid;
				pid = $(this).attr("data-remote-pid");
				load.dim.query("getProcess", pid, function (process) {
					load.ppm.open(process);
					load.tpm.refresh("ui", load.ppm.getProgramList());
					load.tpm.close(me);
				});
			});
		};
	};
});